<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <title>BookWriter</title>
  <%= stylesheet_link_tag "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body onload="addSimpleSearch(document.getElementById('search_window_div'))">

<div id="layout_container">
  <div id="top">

    <% if user_signed_in? %>
        <a href="javascript:toggleSeachingWindows(document.getElementById('search_window_div'))" id="showSearch">Öffne Suche</a> |
        <%= link_to I18n.t('views.layout.home'), books_path %> |
        <%= "#{I18n.t('views.layout.account')}: #{current_user.username}" %> |
        <%= link_to I18n.t('views.layout.my_account'), edit_user_registration_path %> |
        <%= link_to I18n.t('views.layout.logout'), destroy_user_session_path, method: :delete %>
    <% end %>

  </div>

  <div id="left">
    <div id="search_window_div" hidden="true" class="search">
      <div id="searchresults" class="search_results">
      </div>
    </div>

    <%= yield :left %>
  </div>

  <div id="content">

    <% if flash[:notice] %>
        <p id="notice"><%= flash[:notice] %></p>
    <% end %>
    <% if flash[:error] %>
        <p class="error"><%= flash[:error] %></p>
    <% end %>

    <%= yield %>

  </div>

</div>

</body>
</html>
